var City = {};
(function (){

   var cities = [];
   
   City.init = function() {

   };
   
   City.load = function () {
        $.ajax("http://localhost:8000/resources/json/city.json"
            , {  success : City.loadSuccess
               , error : City.loadError
        });

        
   }

   City.loadSuccess = function (data) {
      cities = data;
   };

   City.loadError = function (result, error , exception)  {
      console.log ('Caraca deu Pau' + exception);
   };

   City.list =  function () {
        if (!cities) City.load();
        return cities;
   };
   	    

   
})(); 